///////////////////////////////////////////////////////////////////////////////
//
// Licensed under the MIT License
//
// Copyright (c) 2010 Chris Colinsky
// All Rights Reserved
//
// version	0.5
// http://code.google.com/p/sugarcookie/
// http://code.google.com/p/sugarcookie/wiki/License
//
////////////////////////////////////////////////////////////////////////////////

package sugarcookie.data.handlers.config.vo {
	public class ViewConfig {
		private var _id:String;
		private var _active:Boolean;
		private var _index:int;
		private var _type:String;
		private var _status:String;
		private var _label:String;
		private var _title:String;
		private var _uri:String;
		private var _dataHandlerArgs:Array;
		private var _dataHandlerClassDef:String;
		private var _viewClassDef:String;
		private var _externalSrc:String;
		private var _children:Array;
		
		public function ViewConfig(id:String,active:String,index:int,type:String,status:String,label:String,title:String,uri:String,dataHandlerArgs:String,dataHandlerClassDef:String,viewClassDef:String,externalSrc:String=null) {
			_id = id;
			_active = active=="true"?true:false;
			_index = index;
			_type = type;
			_status = status;
			_label = label;
			_title = title;
			_uri = uri;
			_dataHandlerArgs = dataHandlerArgs!=null?dataHandlerArgs.split(","):null;
			_dataHandlerClassDef = dataHandlerClassDef;
			_viewClassDef = viewClassDef;
			_externalSrc = externalSrc;
			
			_children = [];
		}
		
		public function addChildView(child:ViewConfig):void {
			_children.push(child);
		}
		public function get children():Array {
			return _children;
		}
		
		public function get id():String { return _id; }
		public function get active():Boolean { return _active; }
		public function get index():int { return _index; }
		public function get type():String { return _type; }
		public function get status():String { return _status; }
		public function set status(value:String):void { _status = value; }
		public function get label():String { return _label; }
		public function get title():String { return _title; }
		public function get uri():String { return _uri; }
		public function get dataHandlerArgs():Array { return _dataHandlerArgs; }
		public function get dataHandlerClassDef():String { return _dataHandlerClassDef; }
		public function get viewClassDef():String { return _viewClassDef; }
		public function get externalSrc():String { return _externalSrc; }
	}
}